<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="no-cache"/>
    <meta http-equiv="Expires" content="-1"/>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <title>修改个人信息</title>

    <script type="text/javascript">
      Ext.onReady(function(){
              Ext.QuickTips.init();
              var random = Math.ceil(Math.random()*(1000-1)+1);
              var userId = <%= params[:id] %>;
              var store = new Ext.data.ArrayStore({
                  fields: ['state'],
                  data : Ext.exampledata.natureDataArray // from states.js
              });

              var editInformationForm = new Ext.form.FormPanel({
                    width: 600,
                    autoHeight: true,
                    //labelAlign: 'top',
                    buttonAlign:'center',
                    fileUpload: true,
                    bodyStyle: 'padding:5px',
                    labelWidth:100,
                    waitMsgTarget: true,
                    frame: true,
                    reader:new Ext.data.JsonReader({
                       },[
                       {name:'id'},
                       {name:'company_name'},
                       {name:'company_address'},
                       {name:'company_nature'},
                       {name:'registered_capital'},
                       {name:'employee_number'},
                       {name:'turnover'},
                       {name:'organization_code'},
                       {name:'business_license'},
                       {name:'legal_person'},
                       {name:'legal_person_id_card'},
                       {name:'tax_number'},
                       {name:'deposit_bank'},
                       {name:'bank_account'},
                       {name:'industry'},
                       {name:'operation'},
                       {name:'introduction'},

                       {name:'linkman'},
                       {name:'linkman_position'},
                       {name:'linkman_phone'},
                       {name:'linkman_mobile'},
                       {name:'linkman_fax'},
                       {name:'linkman_email'}

                      ]
                    ),
                    items:[{
                           xtype:'hidden',
                           name:'id'
                     },{
                          xtype:'fieldset',
                          title:'企业基本信息',
                          autoHeight:true,
                          items:[{
                              layout:'column',
                              width:550,
                              items:[{
                                  columnWidth:.5,
                                  layout:'form',
                                  labelAlign: 'left',
                                  items:[{
                                      xtype:'textfield',
                                      fieldLabel: '企业名称',
                                      name: 'company_name',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'combo',
                                      store: store,
                                      displayField:'state',
                                      fieldLabel:'企业性质',
                                      typeAhead: true,
                                      mode: 'local',
                                      name:'company_nature',
                                      width:150,
                                      forceSelection: true,
                                      disabled:true,
                                      triggerAction: 'all',
                                      selectOnFocus:true
                                  },{
                                      xtype:'numberfield',
                                      fieldLabel: '企业人数',
                                      name: 'employee_number',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '组织机构代码',
                                      name: 'organization_code',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '法人姓名',
                                      name: 'legal_person',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '国税登记证号码',
                                      name: 'tax_number',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '开户银行帐号',
                                      name: 'bank_account',
                                      readOnly:true,
                                      width:150
                                  }]
                              },{
                                  columnWidth:.5,
                                  layout:'form',
                                  labelAlign: 'left',
                                  items:[{
                                      xtype:'textfield',
                                      fieldLabel: '公司网址',
                                      name:'company_address',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'numberfield',
                                      fieldLabel: '注册资金(百万)',
                                      name: 'registered_capital',
                                      readOnly:true,
                                      width:150
                                  },{
                                      fieldLabel: '上年营业额(万)',
                                      xtype:'numberfield',
                                      name: 'turnover',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '营业执照号码',
                                      name:'business_license',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '法人身份证号码',
                                      name: 'legal_person_id_card',
                                      readOnly:true,
                                      width:150
                                  },{
                                      fieldLabel: '开户银行名称',
                                      xtype:'textfield',
                                      name: 'deposit_bank',
                                      readOnly:true,
                                      width:150
                                  }]
                              },{
                                  columnWidth:1,
                                  layout:'form',
                                  labelAlign: 'top',
                                  width:550,
                                  items:[{
                                      xtype:'textarea',
                                      fieldLabel: '所属行业',
                                      name:'industry',
                                      readOnly:true,
                                      height:50,
                                      width:527
                                  },{
                                      xtype:'textarea',
                                      fieldLabel: '主营业务',
                                      name: 'operation',
                                      readOnly:true,
                                      height:50,
                                      width:527
                                  },{
                                      fieldLabel: '企业简介',
                                      xtype:'textarea',
                                      name: 'introduction',
                                      readOnly:true,
                                      height:50,
                                      width:527
                                  }]
                              }]
                          }]
                              
                     },{
                          xtype:'fieldset',
                          title:'联系人基本信息',
                          autoHeight:true,
                          items:[{
                              layout:'column',
                              width:550,
                              items:[{
                                  columnWidth:.5,
                                  layout:'form',
                                  labelAlign: 'left',
                                  items:[{
                                      xtype:'textfield',
                                      fieldLabel: '姓名',
                                      name: 'linkman',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '电话号码',
                                      name: 'linkman_phone',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '传真号码',
                                      name: 'linkman_fax',
                                      readOnly:true,
                                      width:150
                                  }]
                              },{
                                  columnWidth:.5,
                                  layout:'form',
                                  labelAlign: 'left',
                                  items:[{
                                      xtype:'textfield',
                                      fieldLabel: '职务',
                                      name:'linkman_position',
                                      readOnly:true,
                                      width:150
                                  },{
                                      xtype:'textfield',
                                      fieldLabel: '手机号码',
                                      name: 'linkman_mobile',
                                      readOnly:true,
                                      width:150
                                  },{
                                      fieldLabel: '电子邮件',
                                      xtype:'textfield',
                                      name: 'linkman_email',
                                      readOnly:true,
                                      width:150
                                  }]
                              }]
                         }]

                     }],
                     buttons:[{
                        text:'关闭',
                        handler:function(){
                          userViewWin.destroy();
                        }
                    }]
                });
          editInformationForm.form.load({
               url: '/vendor/edit?id=' + userId,
               success: function(form, action){
               },
               failure: function(form, action){
                  Ext.MessageBox.alert('提示信息', '信息加载失败');
               }
          });
          editInformationForm.render('edit_information_form');
      })
    </script>
  </head>
  <body>
     <div id="edit_information_form"></div>
  </body>
</html>
